home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch10e < prev    next >
Encoding:
Text File  |  1991-02-08  |  52.4 KB  |  1,918 lines

  1. Subject:  v12i029:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch10e
  2. Newsgroups: comp.sources.games
  3. Approved: billr@saab.CNA.TEK.COM
  4.  
  5. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  6. Posting-number: Volume 12, Issue 29
  7. Archive-name: NetHack3/Patch10e
  8. Patch-To: NetHack3: Volume 7, Issue 56-93
  9. Environment: 
  10.  
  11.  
  12.  
  13. #! /bin/sh
  14. # This is a shell archive.  Remove anything before this line, then unpack
  15. # it by saving it into a file and typing "sh file".  To overwrite existing
  16. # files, type "sh file -c".  You can also feed this as standard input via
  17. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  18. # will see the following message at the end:
  19. #        "End of archive 5 (of 8)."
  20. # Contents:  patch10.02
  21. # Wrapped by billr@saab on Fri Feb  8 17:19:00 1991
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. if test -f 'patch10.02' -a "${1}" != "-c" ; then 
  24.   echo shar: Renaming existing file \"'patch10.02'\" to \"'patch10.02.orig'\"
  25.   mv -f 'patch10.02' 'patch10.02.orig'
  26. fi
  27. echo shar: Extracting \"'patch10.02'\" \(50088 characters\)
  28. sed "s/^X//" >'patch10.02' <<'END_OF_FILE'
  29. X*** src/Makefile.src    Wed May 30 00:27:20 1990
  30. X--- src/Makefile.src    Sun Feb  3 17:16:02 1991
  31. X***************
  32. X*** 50,55 ****
  33. X--- 50,62 ----
  34. X  # (as long as it claims to be __STDC__ but isn't)
  35. X  # CFLAGS = -DAPOLLO -O -I../include
  36. X  
  37. X+ # flags for AIX 3.1 cc on IBM RS/6000 to define
  38. X+ # a suitable subset of standard libraries
  39. X+ # CFLAGS = -D_NO_PROTO -D_XOPEN_SOURCE -O -I../include
  40. X+ 
  41. X+ # flags for DECstations running 4.0 or greater using the native C compiler
  42. X+ # CFLAGS = -O -Olimit 1000 -I../include
  43. X+ 
  44. X  # flags for debugging:
  45. X  # CFLAGS = -g -I../include
  46. X  
  47. X***************
  48. X*** 61,66 ****
  49. X--- 68,75 ----
  50. X  # on 386 Xenix, the -ltermlib tputs() seems not to work; use -lcurses instead
  51. X  # Sysatt uses shared library in lieu of this option
  52. X  # Systos needs -lcurses16 if you use -mshort
  53. X+ # AIX 3.1 on RS/6000 likes -lcurses if TERMINFO defined in config.h
  54. X+ # and -ltermcap otherwise
  55. X  #
  56. X  # TERMLIB = -ltermcap
  57. X  # TERMLIB = -lcurses
  58. X*** src/alloc.c    Thu Mar 29 09:13:26 1990
  59. X--- src/alloc.c    Sat Jan  5 15:06:40 1991
  60. X***************
  61. X*** 2,7 ****
  62. X--- 2,9 ----
  63. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  64. X  /* NetHack may be freely redistributed.  See license for details. */
  65. X  
  66. X+ /* to get the malloc() prototype from system.h */
  67. X+ #define ALLOC_C        /* comment line for pre-compiled headers */
  68. X  /* since this file is also used in auxiliary programs, don't include all the 
  69. X   * function declarations for all of nethack
  70. X   */
  71. X*** src/apply.c    Tue Jun 26 21:20:14 1990
  72. X--- src/apply.c    Sat Jan  5 15:08:29 1991
  73. X***************
  74. X*** 1269,1275 ****
  75. X          int did_stat = 0;
  76. X          int i = rn2(A_MAX);
  77. X          for(j=0; j<A_MAX; j++) {
  78. X!             if ((blessed || j==i) && ABASE(i) < AMAX(i)) {
  79. X                  did_something++;
  80. X                  /* They may have to use it several times... */
  81. X                  if (!did_stat) {
  82. X--- 1269,1279 ----
  83. X          int did_stat = 0;
  84. X          int i = rn2(A_MAX);
  85. X          for(j=0; j<A_MAX; j++) {
  86. X!             /* don't recover strength lost while hungry */
  87. X!             if ((blessed || j==i) &&
  88. X!                 ((j != A_STR || u.uhs < WEAK)
  89. X!                 ? (ABASE(i) < AMAX(i))
  90. X!                 : (ABASE(A_STR) < (AMAX(A_STR) - 1)))) {
  91. X                  did_something++;
  92. X                  /* They may have to use it several times... */
  93. X                  if (!did_stat) {
  94. X*** src/artifact.c    Sat May 26 23:17:50 1990
  95. X--- src/artifact.c    Sat Jan  5 14:59:08 1991
  96. X***************
  97. X*** 164,170 ****
  98. X  {
  99. X      register const struct artifact *artif;
  100. X  
  101. X!     if(otmp)
  102. X          if(strlen(ONAME(otmp)))
  103. X          for(artif = artilist; artif->otyp; artif++)
  104. X              if(artif->otyp == otmp->otyp &&
  105. X--- 164,170 ----
  106. X  {
  107. X      register const struct artifact *artif;
  108. X  
  109. X!     if(otmp && otmp->onamelth)
  110. X          if(strlen(ONAME(otmp)))
  111. X          for(artif = artilist; artif->otyp; artif++)
  112. X              if(artif->otyp == otmp->otyp &&
  113. X***************
  114. X*** 309,315 ****
  115. X  struct permonst *ptr;
  116. X  {
  117. X      if(!(weap->spfx & (SPFX_DBONUS | SPFX_ATTK)))
  118. X!         return(0);
  119. X  
  120. X      if(weap->spfx & SPFX_DMONS)
  121. X          return((ptr == &mons[(int)weap->mtype]));
  122. X--- 309,315 ----
  123. X  struct permonst *ptr;
  124. X  {
  125. X      if(!(weap->spfx & (SPFX_DBONUS | SPFX_ATTK)))
  126. X!         return(weap->attk.adtyp == AD_PHYS);
  127. X  
  128. X      if(weap->spfx & SPFX_DMONS)
  129. X          return((ptr == &mons[(int)weap->mtype]));
  130. X*** src/bones.c    Mon May 21 22:21:08 1990
  131. X--- src/bones.c    Sat Jan  5 15:06:57 1991
  132. X***************
  133. X*** 92,99 ****
  134. X              && (!is_artifact(otmp) ||
  135. X                  (exist_artifact(otmp,ONAME(otmp)) && restore))
  136. X  #endif
  137. X!         )
  138. X              otmp->onamelth = 0;
  139. X  #ifdef NAMED_ITEMS
  140. X          else if (is_artifact(otmp) && restore)
  141. X              artifact_exists(otmp,ONAME(otmp),TRUE);
  142. X--- 92,101 ----
  143. X              && (!is_artifact(otmp) ||
  144. X                  (exist_artifact(otmp,ONAME(otmp)) && restore))
  145. X  #endif
  146. X!         ) {
  147. X              otmp->onamelth = 0;
  148. X+             *ONAME(otmp) = '\0';
  149. X+         }
  150. X  #ifdef NAMED_ITEMS
  151. X          else if (is_artifact(otmp) && restore)
  152. X              artifact_exists(otmp,ONAME(otmp),TRUE);
  153. X***************
  154. X*** 218,223 ****
  155. X--- 220,226 ----
  156. X          atl(u.ux, u.uy, mtmp->data->mlet);
  157. X          Your("body rises from the dead as %s...",
  158. X              an(mons[u.ugrave_arise].mname));
  159. X+         more();
  160. X      }
  161. X      mtmp->m_lev = (u.ulevel ? u.ulevel : 1);
  162. X      mtmp->mhp = mtmp->mhpmax = u.uhpmax;
  163. X***************
  164. X*** 307,312 ****
  165. X--- 310,323 ----
  166. X      bflush(fd);
  167. X  #endif
  168. X      (void) close(fd);
  169. X+ #if defined(VMS) && !defined(SECURE)
  170. X+     /*
  171. X+        Re-protect bones file with world:read+write+execute+delete access.
  172. X+        umask() doesn't seem very reliable; also, vaxcrtl won't let us set
  173. X+        delete access without write access, which is what's really wanted.
  174. X+      */
  175. X+     (void) chmod(bones, FCMASK | 007);  /* allow other users full access */
  176. X+ #endif
  177. X  #ifdef MACOS
  178. X      {
  179. X          FInfo    fndrInfo;
  180. X***************
  181. X*** 326,332 ****
  182. X              SetFInfo(name, (short)0, &fndrInfo);
  183. X          SetVol(0L, oldVol);
  184. X      }
  185. X! #endif
  186. X  #ifdef COMPRESS
  187. X      compress_bones();
  188. X  #endif
  189. X--- 337,343 ----
  190. X              SetFInfo(name, (short)0, &fndrInfo);
  191. X          SetVol(0L, oldVol);
  192. X      }
  193. X! #endif /* MACOS */
  194. X  #ifdef COMPRESS
  195. X      compress_bones();
  196. X  #endif
  197. X*** src/dbridge.c    Thu May 31 00:31:26 1990
  198. X--- src/dbridge.c    Sun Jan 27 13:36:18 1991
  199. X***************
  200. X*** 425,435 ****
  201. X              done(how);
  202. X              /* So, you didn't die */
  203. X              if (!e_survives_at(etmp, etmp->ex, etmp->ey)) {
  204. X                  pline("A %s force teleports you away...",
  205. X!                             Hallucination ? "normal" : "strange");
  206. X!                 (void) enexto(&xy, etmp->ex, etmp->ey,
  207. X!                                 etmp->edata);
  208. X                  teleds(xy.x, xy.y);
  209. X              }
  210. X          }
  211. X      } else {
  212. X--- 425,439 ----
  213. X              done(how);
  214. X              /* So, you didn't die */
  215. X              if (!e_survives_at(etmp, etmp->ex, etmp->ey)) {
  216. X+                 if (enexto(&xy, etmp->ex, etmp->ey,
  217. X+                                 etmp->edata)) {
  218. X                  pline("A %s force teleports you away...",
  219. X!                       Hallucination ? "normal" : "strange");
  220. X                  teleds(xy.x, xy.y);
  221. X+                 }
  222. X+                 /* otherwise on top of the drawbridge is the
  223. X+                  * only viable spot in the dungeon, so stay there
  224. X+                  */
  225. X              }
  226. X          }
  227. X      } else {
  228. X***************
  229. X*** 787,798 ****
  230. X--- 791,812 ----
  231. X      do_entity(&(occupants[0]));
  232. X      do_entity(&(occupants[1]));
  233. X      redosym(x, y);
  234. X+     if(OBJ_AT(x,y) && flags.soundok)
  235. X+         You("hear smashing and crushing.");
  236. X      for (otmp = level.objects[x][y]; otmp; otmp = otmp2) {
  237. X          otmp2 = otmp->nexthere;
  238. X+         if (otmp == uball)
  239. X+             unpunish();
  240. X+         if (otmp == uchain)
  241. X+             continue;
  242. X          delobj(otmp);
  243. X      }
  244. X      for (otmp = level.objects[x2][y2]; otmp; otmp = otmp2) {
  245. X          otmp2 = otmp->nexthere;
  246. X+         if (otmp == uball)
  247. X+             unpunish();
  248. X+         if (otmp == uchain)
  249. X+             continue;
  250. X          delobj(otmp);
  251. X      }
  252. X      redosym(x2, y2);
  253. X*** src/do.c    Thu May 31 00:31:28 1990
  254. X--- src/do.c    Fri Jan 18 09:32:11 1991
  255. X***************
  256. X*** 11,16 ****
  257. X--- 11,26 ----
  258. X   * below 
  259. X   */
  260. X  #include <errno.h>
  261. X+ 
  262. X+ # ifdef _MSC_VER    /* MSC 6.0 defines errno quite differently */
  263. X+ #  if (_MSC_VER >= 600)
  264. X+ #   define SKIP_ERRNO
  265. X+ #  endif
  266. X+ # endif
  267. X+ #endif /* STUPID_CPP */
  268. X+ 
  269. X+ #ifndef SKIP_ERRNO
  270. X+ extern int errno;
  271. X  #endif
  272. X  
  273. X  #if defined(DGK)
  274. X***************
  275. X*** 640,646 ****
  276. X   *    up a set of stairs sometimes does some very strange things!
  277. X   */
  278. X  #ifdef HARD
  279. X!     if(Inhell && up && !at_ladder &&
  280. X              (dlevel < MAXLEVEL-3) && u.uhave_amulet) {
  281. X          int olev = newlevel;
  282. X  
  283. X--- 650,659 ----
  284. X   *    up a set of stairs sometimes does some very strange things!
  285. X   */
  286. X  #ifdef HARD
  287. X!     if(Inhell && up &&
  288. X! # ifdef STRONGHOLD
  289. X!            !at_ladder &&
  290. X! # endif
  291. X              (dlevel < MAXLEVEL-3) && u.uhave_amulet) {
  292. X          int olev = newlevel;
  293. X  
  294. X***************
  295. X*** 818,824 ****
  296. X  #else
  297. X          if((fd = open(lock,0)) < 0) {
  298. X  #endif
  299. X-             extern int errno;
  300. X              pline("Cannot open \"%s\" (errno %d).", lock, errno);
  301. X              pline("Probably someone removed it.");
  302. X              done(TRICKED);
  303. X--- 831,836 ----
  304. X*** src/do_name.c    Thu May 31 00:31:28 1990
  305. X--- src/do_name.c    Sat Jan  5 14:59:15 1991
  306. X***************
  307. X*** 149,154 ****
  308. X--- 149,158 ----
  309. X      register char *curr;
  310. X      boolean blank;
  311. X  
  312. X+     if (Hallucination) {
  313. X+         You("would never recognize it anyway.");
  314. X+         return 0;
  315. X+     }
  316. X      cc.x = u.ux;
  317. X      cc.y = u.uy;
  318. X      getpos(&cc, 0, "the monster you want to name");
  319. X***************
  320. X*** 428,434 ****
  321. X           * or 'Asidonhopo the blue dragon'.
  322. X           */
  323. X          Strcat(buf, " ");
  324. X!     } else if(mtmp->mnamelth && !vb) {
  325. X          if(isinvis) {
  326. X              Strcpy(buf, "the invisible ");
  327. X              Strcat(buf, NAME(mtmp));
  328. X--- 432,438 ----
  329. X           * or 'Asidonhopo the blue dragon'.
  330. X           */
  331. X          Strcat(buf, " ");
  332. X!     } else if(mtmp->mnamelth && !vb && !Hallucination) {
  333. X          if(isinvis) {
  334. X              Strcpy(buf, "the invisible ");
  335. X              Strcat(buf, NAME(mtmp));
  336. X***************
  337. X*** 460,466 ****
  338. X              Strcat(buf, "the ");
  339. X          Strcat(buf, Hallucination ? rndmonnam() : mtmp->data->mname);
  340. X      }
  341. X!     if(vb && mtmp->mnamelth) {
  342. X          Strcat(buf, " called ");
  343. X          Strcat(buf, NAME(mtmp));
  344. X      }
  345. X--- 464,470 ----
  346. X              Strcat(buf, "the ");
  347. X          Strcat(buf, Hallucination ? rndmonnam() : mtmp->data->mname);
  348. X      }
  349. X!     if(vb && mtmp->mnamelth && !Hallucination) {
  350. X          Strcat(buf, " called ");
  351. X          Strcat(buf, NAME(mtmp));
  352. X      }
  353. X*** src/do_wear.c    Sun May 27 00:50:58 1990
  354. X--- src/do_wear.c    Thu Jan 31 12:35:27 1991
  355. X***************
  356. X*** 103,110 ****
  357. X  STATIC_PTR
  358. X  int
  359. X  Boots_on() {
  360. X!     long oldprop =
  361. X!         u.uprops[objects[uarmf->otyp].oc_oprop].p_flgs & ~(WORN_BOOTS | TIMEOUT);
  362. X  
  363. X      switch(uarmf->otyp) {
  364. X      case LOW_BOOTS:
  365. X--- 103,109 ----
  366. X  STATIC_PTR
  367. X  int
  368. X  Boots_on() {
  369. X!     long oldprop = u.uprops[objects[uarmf->otyp].oc_oprop].p_flgs & ~WORN_BOOTS;
  370. X  
  371. X      switch(uarmf->otyp) {
  372. X      case LOW_BOOTS:
  373. X***************
  374. X*** 114,122 ****
  375. X      case JUMPING_BOOTS:
  376. X          break;
  377. X      case SPEED_BOOTS:
  378. X!         if (!oldprop) {
  379. X              makeknown(uarmf->otyp);
  380. X!             You("feel yourself speed up.");
  381. X          }
  382. X          break;
  383. X      case ELVEN_BOOTS:
  384. X--- 113,124 ----
  385. X      case JUMPING_BOOTS:
  386. X          break;
  387. X      case SPEED_BOOTS:
  388. X!         /* Speed boots are still better than intrinsic speed, */
  389. X!         /* though not better than potion speed */
  390. X!         if (!(oldprop & TIMEOUT)) {
  391. X              makeknown(uarmf->otyp);
  392. X!             You("feel yourself speed up%s.",
  393. X!                 oldprop ? " a bit more" : "");
  394. X          }
  395. X          break;
  396. X      case ELVEN_BOOTS:
  397. X***************
  398. X*** 126,132 ****
  399. X          }
  400. X          break;
  401. X      case FUMBLE_BOOTS:
  402. X!         if (!oldprop)
  403. X              Fumbling += rnd(20);
  404. X          break;
  405. X      case LEVITATION_BOOTS:
  406. X--- 128,134 ----
  407. X          }
  408. X          break;
  409. X      case FUMBLE_BOOTS:
  410. X!         if (!(oldprop & ~TIMEOUT))
  411. X              Fumbling += rnd(20);
  412. X          break;
  413. X      case LEVITATION_BOOTS:
  414. X***************
  415. X*** 146,160 ****
  416. X      /* For levitation, float_down() returns if Levitation, so we
  417. X       * must do a setworn() _before_ the levitation case.
  418. X       */
  419. X!     long oldprop =
  420. X!         u.uprops[objects[uarmf->otyp].oc_oprop].p_flgs & ~(WORN_BOOTS | TIMEOUT);
  421. X  
  422. X      setworn((struct obj *)0, W_ARMF);
  423. X      switch(obj->otyp) {
  424. X      case SPEED_BOOTS:
  425. X!         if (!oldprop) {
  426. X              makeknown(obj->otyp);
  427. X!             You("feel yourself slow down.");
  428. X          }
  429. X          break;
  430. X      case WATER_WALKING_BOOTS:
  431. X--- 148,162 ----
  432. X      /* For levitation, float_down() returns if Levitation, so we
  433. X       * must do a setworn() _before_ the levitation case.
  434. X       */
  435. X!     long oldprop = u.uprops[objects[uarmf->otyp].oc_oprop].p_flgs & ~WORN_BOOTS;
  436. X  
  437. X      setworn((struct obj *)0, W_ARMF);
  438. X      switch(obj->otyp) {
  439. X      case SPEED_BOOTS:
  440. X!         if (!(oldprop & TIMEOUT)) {
  441. X              makeknown(obj->otyp);
  442. X!             You("feel yourself slow down%s.",
  443. X!                 oldprop ? " a bit" : "");
  444. X          }
  445. X          break;
  446. X      case WATER_WALKING_BOOTS:
  447. X***************
  448. X*** 175,181 ****
  449. X          }
  450. X          break;
  451. X      case FUMBLE_BOOTS:
  452. X!         if (!oldprop)
  453. X              Fumbling = 0;
  454. X          break;
  455. X      case LEVITATION_BOOTS:
  456. X--- 177,183 ----
  457. X          }
  458. X          break;
  459. X      case FUMBLE_BOOTS:
  460. X!         if (!(oldprop & ~TIMEOUT))
  461. X              Fumbling = 0;
  462. X          break;
  463. X      case LEVITATION_BOOTS:
  464. X***************
  465. X*** 501,508 ****
  466. X--- 503,516 ----
  467. X          }
  468. X          (void)strcat(SAVEF, ".sav");
  469. X  # else
  470. X+ #  ifdef MACOS
  471. X+         strncpy(SAVEF, plname, (FILENAME - 2));  /* .e */
  472. X+         SAVEF[(FILENAME - 2)] = '\0';
  473. X+         regularize(SAVEF);
  474. X+ #  else
  475. X          Sprintf(SAVEF, "save/%d%s", getuid(), plname);
  476. X          regularize(SAVEF+5);        /* avoid . or / in name */
  477. X+ #  endif
  478. X  # endif
  479. X  #endif
  480. X  #ifdef WIZARD
  481. X*** src/dogmove.c    Sat May 26 23:17:41 1990
  482. X--- src/dogmove.c    Mon Feb  4 16:32:11 1991
  483. X***************
  484. X*** 29,46 ****
  485. X  
  486. X      if(edog->hungrytime < moves)
  487. X          edog->hungrytime = moves;
  488. X!     /* Note: to get the correct percentage-eaten in case oeaten is set,
  489. X!      * use "obj->owt / obj->quan / base-weight".  It so happens that here
  490. X!      * we want to multiply by obj->quan, which thus cancels out.
  491. X       * It is arbitrary that the pet takes the same length of time to eat
  492. X!      * as a human, but gets 5X as much nutrition.
  493. X       */
  494. X      if(obj->otyp == CORPSE) {
  495. X          mtmp->meating = 3 + (mons[obj->corpsenm].cwt >> 2);
  496. X!         nutrit = 5 * mons[obj->corpsenm].cnutrit;
  497. X      } else {
  498. X          mtmp->meating = objects[obj->otyp].oc_delay;
  499. X!         nutrit = 5 * objects[obj->otyp].nutrition;
  500. X      }
  501. X      if(obj->oeaten) {
  502. X          mtmp->meating = eaten_stat(mtmp->meating, obj);
  503. X--- 29,44 ----
  504. X  
  505. X      if(edog->hungrytime < moves)
  506. X          edog->hungrytime = moves;
  507. X!     /*
  508. X       * It is arbitrary that the pet takes the same length of time to eat
  509. X!      * as a human, but gets 4X as much nutrition.
  510. X       */
  511. X      if(obj->otyp == CORPSE) {
  512. X          mtmp->meating = 3 + (mons[obj->corpsenm].cwt >> 2);
  513. X!         nutrit = 4 * mons[obj->corpsenm].cnutrit;
  514. X      } else {
  515. X          mtmp->meating = objects[obj->otyp].oc_delay;
  516. X!         nutrit = 4 * objects[obj->otyp].nutrition;
  517. X      }
  518. X      if(obj->oeaten) {
  519. X          mtmp->meating = eaten_stat(mtmp->meating, obj);
  520. X***************
  521. X*** 50,56 ****
  522. X      mtmp->mconf = 0;
  523. X      if (mtmp->mtame < 20) mtmp->mtame++;
  524. X      if(cansee(x,y))
  525. X!         pline("%s eats %s.", Monnam(mtmp), doname(obj));
  526. X      /* perhaps this was a reward */
  527. X      if(otyp != CADAVER)
  528. X  #ifdef LINT
  529. X--- 48,54 ----
  530. X      mtmp->mconf = 0;
  531. X      if (mtmp->mtame < 20) mtmp->mtame++;
  532. X      if(cansee(x,y))
  533. X!         pline("%s eats %s.", Monnam(mtmp), singular(obj, doname));
  534. X      /* perhaps this was a reward */
  535. X      if(otyp != CADAVER)
  536. X  #ifdef LINT
  537. X***************
  538. X*** 59,65 ****
  539. X          edog->apport += (unsigned)(200L/
  540. X          ((long)edog->dropdist+moves-edog->droptime));
  541. X  #endif
  542. X!     delobj(obj);
  543. X  }
  544. X  
  545. X  #endif /* OVLB */
  546. X--- 57,66 ----
  547. X          edog->apport += (unsigned)(200L/
  548. X          ((long)edog->dropdist+moves-edog->droptime));
  549. X  #endif
  550. X!     if (obj->quan > 1)
  551. X!         obj->quan--;
  552. X!     else
  553. X!         delobj(obj);
  554. X  }
  555. X  
  556. X  #endif /* OVLB */
  557. X*** src/eat.c    Thu May 31 00:31:30 1990
  558. X--- src/eat.c    Sun Feb  3 12:34:00 1991
  559. X***************
  560. X*** 1309,1315 ****
  561. X--- 1309,1318 ----
  562. X              pline("Stop eating? ");
  563. X              if(yn() == 'y')
  564. X  #endif
  565. X+             {
  566. X                  reset_eat();
  567. X+                 nomovemsg = NULL;
  568. X+             }
  569. X              }
  570. X          }
  571. X            }
  572. X***************
  573. X*** 1522,1534 ****
  574. X  register int base;
  575. X  register struct obj *obj;
  576. X  {
  577. X!     base *= obj->oeaten;
  578. X  
  579. X      if (obj->otyp == CORPSE) 
  580. X          base = mons[obj->corpsenm].cnutrit ?
  581. X!                 base / mons[obj->corpsenm].cnutrit : 0;
  582. X      else base = objects[obj->otyp].nutrition ?
  583. X!                 base / objects[obj->otyp].nutrition : 0;
  584. X      return (base < 1) ? 1 : base;
  585. X  }
  586. X  
  587. X--- 1525,1540 ----
  588. X  register int base;
  589. X  register struct obj *obj;
  590. X  {
  591. X!     long long_base;
  592. X  
  593. X+     long_base = (long )base;
  594. X+     long_base *= (long )obj->oeaten;
  595. X+ 
  596. X      if (obj->otyp == CORPSE) 
  597. X          base = mons[obj->corpsenm].cnutrit ?
  598. X!         (int)(long_base / (long )mons[obj->corpsenm].cnutrit) : 0;
  599. X      else base = objects[obj->otyp].nutrition ?
  600. X!         (int)(long_base / (long )objects[obj->otyp].nutrition) : 0;
  601. X      return (base < 1) ? 1 : base;
  602. X  }
  603. X  
  604. X*** src/end.c    Tue Jun 26 21:20:16 1990
  605. X--- src/end.c    Fri Feb  1 10:48:14 1991
  606. X***************
  607. X*** 348,354 ****
  608. X  #endif
  609. X      if(Lifesaved && how <= GENOCIDED) {
  610. X          u.uswldtim = 0;
  611. X!         if(u.uhpmax < 0) u.uhpmax = 10;    /* arbitrary */
  612. X          u.uhp = u.uhpmax;
  613. X          adjattrib(A_CON, -1, TRUE);
  614. X          pline("But wait...");
  615. X--- 348,354 ----
  616. X  #endif
  617. X      if(Lifesaved && how <= GENOCIDED) {
  618. X          u.uswldtim = 0;
  619. X!         if(u.uhpmax <= 0) u.uhpmax = 10;    /* arbitrary */
  620. X          u.uhp = u.uhpmax;
  621. X          adjattrib(A_CON, -1, TRUE);
  622. X          pline("But wait...");
  623. X***************
  624. X*** 355,360 ****
  625. X--- 355,364 ----
  626. X          makeknown(AMULET_OF_LIFE_SAVING);
  627. X          Your("medallion %s!",
  628. X                !Blind ? "begins to glow" : "feels warm");
  629. X+         if (how == CHOKING) {
  630. X+             init_uhunger();
  631. X+             You("vomit ...");
  632. X+         }
  633. X          You("feel much better!");
  634. X          pline("The medallion crumbles to dust!");
  635. X          useup(uamul);
  636. X***************
  637. X*** 377,386 ****
  638. X          pline("Die? ");
  639. X          if(yn() == 'y') goto die;
  640. X          u.uswldtim = 0;
  641. X!         if(u.uhpmax < 0) u.uhpmax = 100;    /* arbitrary */
  642. X          u.uhp = u.uhpmax;
  643. X          if (u.uhunger < 500) u.uhunger = 500;
  644. X!         pline("Ok, so you don't die.");
  645. X          nomovemsg = "You survived that attempt on your life.";
  646. X          curs_on_u();
  647. X          flags.move = 0;
  648. X--- 381,392 ----
  649. X          pline("Die? ");
  650. X          if(yn() == 'y') goto die;
  651. X          u.uswldtim = 0;
  652. X!         if(u.uhpmax <= 0) u.uhpmax = 100;    /* arbitrary */
  653. X          u.uhp = u.uhpmax;
  654. X          if (u.uhunger < 500) u.uhunger = 500;
  655. X!         if (how == CHOKING) init_uhunger();
  656. X!         pline("Ok, so you don't %s.",
  657. X!             (how == CHOKING) ? "choke" : "die");
  658. X          nomovemsg = "You survived that attempt on your life.";
  659. X          curs_on_u();
  660. X          flags.move = 0;
  661. X*** src/getline.c    Wed Apr 11 22:17:42 1990
  662. X--- src/getline.c    Tue Jan 29 16:32:34 1991
  663. X***************
  664. X*** 9,15 ****
  665. X   * Some systems may have getchar() return EOF for various reasons, and
  666. X   * we should not quit before seeing at least NR_OF_EOFS consecutive EOFs.
  667. X   */
  668. X! #if defined(SYSV) || defined(DGUX)
  669. X  #define    NR_OF_EOFS    20
  670. X  #endif
  671. X  #ifdef MACOS
  672. X--- 9,15 ----
  673. X   * Some systems may have getchar() return EOF for various reasons, and
  674. X   * we should not quit before seeing at least NR_OF_EOFS consecutive EOFs.
  675. X   */
  676. X! #if defined(SYSV) || defined(DGUX) || defined(HPUX)
  677. X  #define    NR_OF_EOFS    20
  678. X  #endif
  679. X  #ifdef MACOS
  680. X***************
  681. X*** 257,266 ****
  682. X  char
  683. X  readchar() {
  684. X      register int sym;
  685. X  
  686. X      (void) fflush(stdout);
  687. X  #ifdef UNIX
  688. X!     if((sym = Getchar()) == EOF)
  689. X  # ifdef NR_OF_EOFS
  690. X      { /*
  691. X         * Some SYSV systems seem to return EOFs for various reasons
  692. X--- 257,276 ----
  693. X  char
  694. X  readchar() {
  695. X      register int sym;
  696. X+ #ifdef UNIX
  697. X+     /* kludge alert: Some Unix variants return funny values if readchar
  698. X+      * is called, interrupted, and then called again from done2().  There
  699. X+      * is non-reentrant code in the internal _filbuf() routine, called by
  700. X+      * getc().
  701. X+      */
  702. X+     static int nesting = 0;
  703. X+     char nestbuf;
  704. X+ #endif
  705. X  
  706. X      (void) fflush(stdout);
  707. X  #ifdef UNIX
  708. X!     if((sym = ((++nesting == 1) ? Getchar() :
  709. X!         (read(fileno(stdin),&nestbuf,1) == 1 ? (int)nestbuf : EOF))) == EOF)
  710. X  # ifdef NR_OF_EOFS
  711. X      { /*
  712. X         * Some SYSV systems seem to return EOFs for various reasons
  713. X***************
  714. X*** 281,286 ****
  715. X--- 291,299 ----
  716. X  #else
  717. X      sym = Getchar();
  718. X  #endif /* UNIX */
  719. X+ #ifdef UNIX
  720. X+     nesting--;
  721. X+ #endif
  722. X      if(flags.toplin == 1)
  723. X          flags.toplin = 2;
  724. X      return((char) sym);
  725. X*** src/hack.c    Tue Jun 26 21:20:18 1990
  726. X--- src/hack.c    Sat Jan  5 14:59:26 1991
  727. X***************
  728. X*** 788,793 ****
  729. X--- 788,801 ----
  730. X      /* suppress "used before set" message */
  731. X      x0 = y0 = m0 = 0;
  732. X  #endif
  733. X+ #ifdef POLYSELF
  734. X+     /* Grid bugs stop if trying to move diagonal, even if blind.  Maybe */
  735. X+     /* they polymorphed while in the middle of a long move. */
  736. X+     if (u.umonnum == PM_GRID_BUG && u.dx && u.dy) {
  737. X+         nomul(0);
  738. X+         return;
  739. X+     }
  740. X+ #endif
  741. X      if(Blind || flags.run == 0) return;
  742. X      for(x = u.ux-1; x <= u.ux+1; x++) for(y = u.uy-1; y <= u.uy+1; y++) {
  743. X          if(!isok(x,y)) continue;
  744. X*** src/invent.c    Thu May 31 00:31:49 1990
  745. X--- src/invent.c    Thu Jan 10 09:52:44 1991
  746. X***************
  747. X*** 14,19 ****
  748. X--- 14,29 ----
  749. X  #ifdef OVL1
  750. X  static boolean FDECL(mergable,(struct obj *,struct obj *));
  751. X  static int FDECL(merged,(struct obj *,struct obj *,int));
  752. X+ # ifdef WIZARD
  753. X+ /* wizards can wish for venom, which will become an invisible inventory
  754. X+  * item without this.  putting it in inv_order would mean venom would
  755. X+  * suddenly become a choice for all the inventory-class commands, which
  756. X+  * would probably cause mass confusion.  the test for inventory venom
  757. X+  * is only WIZARD and not wizard because the wizard can leave venom lying
  758. X+  * around on a bones level for normal players to find.
  759. X+  */
  760. X+ char venom_inv[] = { VENOM_SYM, 0 };
  761. X+ # endif
  762. X  #endif /* OVL1 */
  763. X  STATIC_DCL void FDECL(assigninvlet,(struct obj *));
  764. X  STATIC_DCL struct obj *FDECL(mkgoldobj,(long));
  765. X***************
  766. X*** 167,173 ****
  767. X          obj->quan--;
  768. X          obj->owt = weight(obj);
  769. X      } else {
  770. X!         if(obj->otyp == CORPSE) food_disappears(obj);
  771. X          setnotworn(obj);
  772. X          freeinv(obj);
  773. X          delete_contents(obj);
  774. X--- 177,183 ----
  775. X          obj->quan--;
  776. X          obj->owt = weight(obj);
  777. X      } else {
  778. X!         if(obj->olet == FOOD_SYM) food_disappears(obj);
  779. X          setnotworn(obj);
  780. X          freeinv(obj);
  781. X          delete_contents(obj);
  782. X***************
  783. X*** 216,222 ****
  784. X  #ifdef WALKIES
  785. X      if(obj->otyp == LEASH && obj->leashmon != 0) o_unleash(obj);
  786. X  #endif
  787. X!     if(obj->otyp == CORPSE) food_disappears(obj);
  788. X  
  789. X      freeobj(obj);
  790. X      unpobj(obj);
  791. X--- 226,232 ----
  792. X  #ifdef WALKIES
  793. X      if(obj->otyp == LEASH && obj->leashmon != 0) o_unleash(obj);
  794. X  #endif
  795. X!     if(obj->olet == FOOD_SYM) food_disappears(obj);
  796. X  
  797. X      freeobj(obj);
  798. X      unpobj(obj);
  799. X***************
  800. X*** 961,967 ****
  801. X          }
  802. X          if(!flags.invlet_constant) if(++ilet > 'z') ilet = 'A';
  803. X      }
  804. X!     if (flags.sortpack && *++invlet) goto nextclass;
  805. X      any[ct] = 0;
  806. X      cornline(2, any);
  807. X  }
  808. X--- 971,985 ----
  809. X          }
  810. X          if(!flags.invlet_constant) if(++ilet > 'z') ilet = 'A';
  811. X      }
  812. X!     if (flags.sortpack) {
  813. X!         if (*++invlet) goto nextclass;
  814. X! #ifdef WIZARD
  815. X!         if (--invlet != venom_inv) {
  816. X!             invlet = venom_inv;
  817. X!             goto nextclass;
  818. X!         }
  819. X! #endif
  820. X!     }
  821. X      any[ct] = 0;
  822. X      cornline(2, any);
  823. X  }
  824. X***************
  825. X*** 1028,1036 ****
  826. X          return(0);
  827. X      }
  828. X  
  829. X!     if((c == 'u' || c == 'U') && !unpd) {
  830. X          You("are not carrying any unpaid objects.");
  831. X          return(0);
  832. X      }
  833. X  
  834. X      stct = 0;
  835. X--- 1046,1057 ----
  836. X          return(0);
  837. X      }
  838. X  
  839. X!     if (c == 'u' || c == 'U') {
  840. X!         if (!unpd) {
  841. X          You("are not carrying any unpaid objects.");
  842. X          return(0);
  843. X+         } else
  844. X+         c = 'u';
  845. X      }
  846. X  
  847. X      stct = 0;
  848. X***************
  849. X*** 1385,1394 ****
  850. X--- 1406,1420 ----
  851. X  #endif
  852. X      "Rings", "Gems"};
  853. X  
  854. X+ #ifdef WIZARD
  855. X+ static const char NEARDATA *venom_name = "Venoms";
  856. X+ #endif
  857. X+ 
  858. X  char *
  859. X  let_to_name(let)
  860. X  char let;
  861. X  {
  862. X+     const char *class_name;
  863. X      const char *pos = index(obj_symbols, let);
  864. X      /* arbitrary buffer size by Tom May (tom@uw-warp) */
  865. X      static char NEARDATA *buf = NULL;
  866. X***************
  867. X*** 1401,1411 ****
  868. X              Boulders/Statues   +  '\0'
  869. X              1234567890123456 = 16 + 1 = 17
  870. X  */
  871. X!     if (pos == NULL) pos = obj_symbols;
  872. X      if (HI && HE)
  873. X!         Sprintf(buf, "%s%s%s", HI, names[pos - obj_symbols], HE);
  874. X      else
  875. X!         Sprintf(buf, "%s", names[pos - obj_symbols]);
  876. X      return (buf);
  877. X  }
  878. X  
  879. X--- 1427,1446 ----
  880. X              Boulders/Statues   +  '\0'
  881. X              1234567890123456 = 16 + 1 = 17
  882. X  */
  883. X! #ifdef WIZARD
  884. X!     if (pos == NULL && let == VENOM_SYM)
  885. X!         class_name = venom_name;
  886. X!     else {
  887. X! #endif
  888. X!         if (pos == NULL) pos = obj_symbols;
  889. X!         class_name = names[pos - obj_symbols];
  890. X! #ifdef WIZARD
  891. X!     }
  892. X! #endif
  893. X      if (HI && HE)
  894. X!         Sprintf(buf, "%s%s%s", HI, class_name, HE);
  895. X      else
  896. X!         Sprintf(buf, "%s", class_name);
  897. X      return (buf);
  898. X  }
  899. X  
  900. X*** src/ioctl.c    Tue May  8 08:52:03 1990
  901. X--- src/ioctl.c    Wed Jan 16 16:42:27 1991
  902. X***************
  903. X*** 12,21 ****
  904. X  #define MONFLAG_H
  905. X  #include "hack.h"
  906. X  
  907. X! #if defined(BSD) || defined(ULTRIX) || defined(HPUX)
  908. X  # ifdef HPUX
  909. X  #include    <bsdtty.h>
  910. X  # else
  911. X  #include    <sgtty.h>
  912. X  # endif
  913. X  struct ltchars ltchars;
  914. X--- 12,24 ----
  915. X  #define MONFLAG_H
  916. X  #include "hack.h"
  917. X  
  918. X! #if defined(BSD) || defined(ULTRIX) || defined(HPUX) || defined(AIX_31)
  919. X  # ifdef HPUX
  920. X  #include    <bsdtty.h>
  921. X  # else
  922. X+ #  if defined(AIX_31) && !defined(_ALL_SOURCE)
  923. X+ #   define _ALL_SOURCE    /* causes struct winsize to be present */
  924. X+ #  endif
  925. X  #include    <sgtty.h>
  926. X  # endif
  927. X  struct ltchars ltchars;
  928. X***************
  929. X*** 30,42 ****
  930. X  
  931. X  void
  932. X  getioctls() {
  933. X! #if defined(BSD) || defined(ULTRIX) || defined(HPUX)
  934. X      (void) ioctl(fileno(stdin), (int) TIOCGLTC, (char *) <chars);
  935. X      (void) ioctl(fileno(stdin), (int) TIOCSLTC, (char *) <chars0);
  936. X  #else
  937. X      (void) ioctl(fileno(stdin), (int) TCGETA, &termio);
  938. X  #endif
  939. X! #if defined(TIOCGWINSZ) && (defined(BSD) || defined(ULTRIX))
  940. X      {
  941. X          /*
  942. X           * ttysize is found on Suns and BSD
  943. X--- 33,45 ----
  944. X  
  945. X  void
  946. X  getioctls() {
  947. X! #if defined(BSD) || defined(ULTRIX) || defined(HPUX) || defined(AIX_31)
  948. X      (void) ioctl(fileno(stdin), (int) TIOCGLTC, (char *) <chars);
  949. X      (void) ioctl(fileno(stdin), (int) TIOCSLTC, (char *) <chars0);
  950. X  #else
  951. X      (void) ioctl(fileno(stdin), (int) TCGETA, &termio);
  952. X  #endif
  953. X! #if defined(TIOCGWINSZ) && (defined(BSD) || defined(ULTRIX) || defined(AIX_31))
  954. X      {
  955. X          /*
  956. X           * ttysize is found on Suns and BSD
  957. X***************
  958. X*** 61,67 ****
  959. X  
  960. X  void
  961. X  setioctls() {
  962. X! #if defined(BSD) || defined(ULTRIX) || defined(HPUX)
  963. X      (void) ioctl(fileno(stdin), (int) TIOCSLTC, (char *) <chars);
  964. X  #else
  965. X      /* Now modified to run under Sys V R3.    - may have to be #ifdef'ed */
  966. X--- 64,70 ----
  967. X  
  968. X  void
  969. X  setioctls() {
  970. X! #if defined(BSD) || defined(ULTRIX) || defined(HPUX) || defined(AIX_31)
  971. X      (void) ioctl(fileno(stdin), (int) TIOCSLTC, (char *) <chars);
  972. X  #else
  973. X      /* Now modified to run under Sys V R3.    - may have to be #ifdef'ed */
  974. X*** src/lev_comp.l    Mon Apr 23 21:56:28 1990
  975. X--- src/lev_comp.l    Mon Feb  4 16:19:20 1991
  976. X***************
  977. X*** 22,31 ****
  978. X--- 22,39 ----
  979. X  int NDECL (yyinput);
  980. X  int NDECL (yywrap);
  981. X  int NDECL (yylex);
  982. X+ # ifdef NeXT
  983. X+ void FDECL (yyunput, (int));
  984. X+ void FDECL (yyoutput, (int));
  985. X+ # else
  986. X  int FDECL (yyunput, (int));
  987. X  int FDECL (yyoutput, (int));
  988. X+ # endif
  989. X  #endif
  990. X  
  991. X+ void FDECL (init_yyin, (FILE *));
  992. X+ void FDECL (init_yyout, (FILE *));
  993. X+ 
  994. X  #ifdef MSDOS
  995. X  #undef exit
  996. X  extern void FDECL(exit, (int));
  997. X***************
  998. X*** 61,67 ****
  999. X  %s MAPC
  1000. X  %%
  1001. X  <MAPC>[-|}{+SK\\#. ]*\n    { line_number++; yymore(); }    
  1002. X! <MAPC>ENDMAP\n    { BEGIN 0;
  1003. X            line_number++;
  1004. X            yytext[yyleng-7] = 0; /* Discard \nENDMAP */
  1005. X            yylval.map = (char *) alloc(strlen(yytext)+1);
  1006. X--- 69,88 ----
  1007. X  %s MAPC
  1008. X  %%
  1009. X  <MAPC>[-|}{+SK\\#. ]*\n    { line_number++; yymore(); }    
  1010. X! <MAPC>ENDMAP\n    {
  1011. X! #ifdef FLEX_SCANNER
  1012. X!           /*
  1013. X!            * There is a bug in Flex 2.3 patch level < 6
  1014. X!            * (absent in previous versions)
  1015. X!            * that results in the following behaviour :
  1016. X!            * Once you enter an yymore(), you never exit from it.
  1017. X!            * This should do the trick!
  1018. X!            */
  1019. X!           extern int yy_more_len;
  1020. X! 
  1021. X!           yy_more_len = 0;
  1022. X! #endif
  1023. X!           BEGIN 0;
  1024. X            line_number++;
  1025. X            yytext[yyleng-7] = 0; /* Discard \nENDMAP */
  1026. X            yylval.map = (char *) alloc(strlen(yytext)+1);
  1027. X***************
  1028. X*** 132,134 ****
  1029. X--- 153,174 ----
  1030. X      return ((long *)malloc (n));
  1031. X  }
  1032. X  #endif
  1033. X+ 
  1034. X+ /* routine to switch to another input file; needed for flex */
  1035. X+ void init_yyin( input_f )
  1036. X+ FILE *input_f;
  1037. X+ {
  1038. X+ #ifdef FLEX_SCANNER
  1039. X+     if (yyin != NULL)
  1040. X+         yyrestart(input_f);
  1041. X+     else
  1042. X+ #endif
  1043. X+         yyin = input_f;
  1044. X+ }
  1045. X+ /* analogous routine (for completeness) */
  1046. X+ void init_yyout( output_f )
  1047. X+ FILE *output_f;
  1048. X+ {
  1049. X+     yyout = output_f;
  1050. X+ }
  1051. X+ 
  1052. X*** src/lev_lex.c    Mon May 28 16:18:56 1990
  1053. X--- src/lev_lex.c    Mon Feb  4 16:46:34 1991
  1054. X***************
  1055. X*** 48,57 ****
  1056. X--- 48,65 ----
  1057. X  int NDECL (yyinput);
  1058. X  int NDECL (yywrap);
  1059. X  int NDECL (yylex);
  1060. X+ # ifdef NeXT
  1061. X+ void FDECL (yyunput, (int));
  1062. X+ void FDECL (yyoutput, (int));
  1063. X+ # else
  1064. X  int FDECL (yyunput, (int));
  1065. X  int FDECL (yyoutput, (int));
  1066. X+ # endif
  1067. X  #endif
  1068. X  
  1069. X+ void FDECL (init_yyin, (FILE *));
  1070. X+ void FDECL (init_yyout, (FILE *));
  1071. X+ 
  1072. X  #ifdef MSDOS
  1073. X  #undef exit
  1074. X  extern void FDECL(exit, (int));
  1075. X***************
  1076. X*** 95,101 ****
  1077. X  { line_number++; yymore(); }
  1078. X  break;
  1079. X  case 2:
  1080. X! { BEGIN 0;
  1081. X            line_number++;
  1082. X            yytext[yyleng-7] = 0; /* Discard \nENDMAP */
  1083. X            yylval.map = (char *) alloc(strlen(yytext)+1);
  1084. X--- 103,122 ----
  1085. X  { line_number++; yymore(); }
  1086. X  break;
  1087. X  case 2:
  1088. X! {
  1089. X! #ifdef FLEX_SCANNER
  1090. X!           /*
  1091. X!            * There is a bug in Flex 2.3 patch level < 6
  1092. X!            * (absent in previous versions)
  1093. X!            * that results in the following behaviour :
  1094. X!            * Once you enter an yymore(), you never exit from it.
  1095. X!            * This should do the trick!
  1096. X!            */
  1097. X!           extern int yy_more_len;
  1098. X! 
  1099. X!           yy_more_len = 0;
  1100. X! #endif
  1101. X!           BEGIN 0;
  1102. X            line_number++;
  1103. X            yytext[yyleng-7] = 0; /* Discard \nENDMAP */
  1104. X            yylval.map = (char *) alloc(strlen(yytext)+1);
  1105. X***************
  1106. X*** 278,283 ****
  1107. X--- 299,323 ----
  1108. X      return ((long *)malloc (n));
  1109. X  }
  1110. X  #endif
  1111. X+ 
  1112. X+ /* routine to switch to another input file; needed for flex */
  1113. X+ void init_yyin( input_f )
  1114. X+ FILE *input_f;
  1115. X+ {
  1116. X+ #ifdef FLEX_SCANNER
  1117. X+     if (yyin != NULL)
  1118. X+         yyrestart(input_f);
  1119. X+     else
  1120. X+ #endif
  1121. X+         yyin = input_f;
  1122. X+ }
  1123. X+ /* analogous routine (for completeness) */
  1124. X+ void init_yyout( output_f )
  1125. X+ FILE *output_f;
  1126. X+ {
  1127. X+     yyout = output_f;
  1128. X+ }
  1129. X+ 
  1130. X  int yyvstop[] ={
  1131. X  0,
  1132. X  
  1133. X*** src/makedefs.c    Sun May 27 20:44:51 1990
  1134. X--- src/makedefs.c    Thu Jan 31 13:45:44 1991
  1135. X***************
  1136. X*** 103,110 ****
  1137. X  
  1138. X  char * FDECL(tmpdup, (const char *));
  1139. X  
  1140. X! #if defined(SYSV) || defined(GENIX) || defined(UNIXDEBUG)
  1141. X! void FDECL(rename, (char *, char *));
  1142. X  #endif
  1143. X  
  1144. X  #ifdef SMALLDATA
  1145. X--- 103,110 ----
  1146. X  
  1147. X  char * FDECL(tmpdup, (const char *));
  1148. X  
  1149. X! #if defined(SYSV) || defined(GENIX)
  1150. X! int FDECL(rename, (const char *, const char *));
  1151. X  #endif
  1152. X  
  1153. X  #ifdef SMALLDATA
  1154. X***************
  1155. X*** 286,292 ****
  1156. X  #if defined(MSDOS) || defined(MACOS)
  1157. X      remove(TRAP_FILE);
  1158. X  #endif
  1159. X!     rename(tempfile, TRAP_FILE);
  1160. X      return;
  1161. X  }
  1162. X  
  1163. X--- 286,292 ----
  1164. X  #if defined(MSDOS) || defined(MACOS)
  1165. X      remove(TRAP_FILE);
  1166. X  #endif
  1167. X!     (void) rename(tempfile, TRAP_FILE);
  1168. X      return;
  1169. X  }
  1170. X  
  1171. X***************
  1172. X*** 308,315 ****
  1173. X--- 308,323 ----
  1174. X      }
  1175. X  
  1176. X      /* get size of true rumors file */
  1177. X+ #ifndef VMS
  1178. X      (void) fseek(stdin, 0L, 2);
  1179. X      true_rumor_size = ftell(stdin);
  1180. X+ #else
  1181. X+     /* seek+tell is only valid for stream format files; since rumors.%%%
  1182. X+        might be in record format, count the acutal data bytes instead.
  1183. X+      */
  1184. X+     true_rumor_size = 0;
  1185. X+     while (gets(in_line) != NULL)  true_rumor_size += strlen(in_line) + 1;
  1186. X+ #endif /* VMS */
  1187. X      (void) fwrite((genericptr_t)&true_rumor_size,sizeof(long),1,stdout);
  1188. X      (void) fseek(stdin, 0L, 0);
  1189. X  
  1190. X***************
  1191. X*** 600,609 ****
  1192. X      return buf;
  1193. X  }
  1194. X  
  1195. X! #if defined(SYSV) || defined(GENIX) || defined(UNIXDEBUG)
  1196. X! void
  1197. X  rename(oldname, newname)
  1198. X! char    *oldname, *newname;
  1199. X  {
  1200. X      if (strcmp(oldname, newname)) {
  1201. X          (void) unlink(newname);
  1202. X--- 608,621 ----
  1203. X      return buf;
  1204. X  }
  1205. X  
  1206. X! #if defined(SYSV) || defined(GENIX)
  1207. X! /* later SYSV (SVR3+?) systems have rename() a la POSIX and BSD.
  1208. X!  * redefining it (with the same functionality) should be ok as long
  1209. X!  * as it's the same type.
  1210. X!  */
  1211. X! int
  1212. X  rename(oldname, newname)
  1213. X! const char    *oldname, *newname;
  1214. X  {
  1215. X      if (strcmp(oldname, newname)) {
  1216. X          (void) unlink(newname);
  1217. X***************
  1218. X*** 610,616 ****
  1219. X          (void) link(oldname, newname);
  1220. X          (void) unlink(oldname);
  1221. X      }
  1222. X!     return;
  1223. X  }
  1224. X  #endif
  1225. X  
  1226. X--- 622,628 ----
  1227. X          (void) link(oldname, newname);
  1228. X          (void) unlink(oldname);
  1229. X      }
  1230. X!     return 0;
  1231. X  }
  1232. X  #endif
  1233. X  
  1234. X*** src/makemon.c    Tue Jun 26 21:20:21 1990
  1235. X--- src/makemon.c    Sun Jan  6 15:55:52 1991
  1236. X***************
  1237. X*** 119,125 ****
  1238. X                      BOULDER : CLUB);
  1239. X          break;
  1240. X          case S_HUMAN:
  1241. X!         if(is_mercenary(ptr))
  1242. X              switch (mm) {
  1243. X  
  1244. X  #ifdef ARMY
  1245. X--- 119,125 ----
  1246. X                      BOULDER : CLUB);
  1247. X          break;
  1248. X          case S_HUMAN:
  1249. X!         if(is_mercenary(ptr)) {
  1250. X              switch (mm) {
  1251. X  
  1252. X  #ifdef ARMY
  1253. X***************
  1254. X*** 140,146 ****
  1255. X                      if (!rn2(7)) (void) mongets(mtmp, SPEAR);
  1256. X                      break;
  1257. X              }
  1258. X!             break;
  1259. X  
  1260. X          case S_HUMANOID:
  1261. X  #ifdef TOLKIEN
  1262. X--- 140,190 ----
  1263. X                      if (!rn2(7)) (void) mongets(mtmp, SPEAR);
  1264. X                      break;
  1265. X              }
  1266. X! #ifdef TOLKIEN
  1267. X!         } else if (is_elf(ptr)) {
  1268. X!             (void)mongets(mtmp,
  1269. X!             rn2(2) ? ELVEN_MITHRIL_COAT : ELVEN_CLOAK);
  1270. X!             if (rn2(2)) (void)mongets(mtmp, ELVEN_LEATHER_HELM);
  1271. X!             if (rn2(3)) (void)mongets(mtmp, ELVEN_DAGGER);
  1272. X!             switch (rn2(3)) {
  1273. X!             case 0:
  1274. X!                 if (!rn2(4)) (void)mongets(mtmp, ELVEN_SHIELD);
  1275. X!                 (void)mongets(mtmp, ELVEN_SHORT_SWORD);
  1276. X!                 (void)mongets(mtmp, ELVEN_BOW);
  1277. X!                 m_initthrow(mtmp, ELVEN_ARROW, 12);
  1278. X!                 break;
  1279. X!             case 1:
  1280. X!                 (void)mongets(mtmp, ELVEN_BROADSWORD);
  1281. X!                 if (rn2(2)) (void)mongets(mtmp, ELVEN_SHIELD);
  1282. X!                 break;
  1283. X!             case 2:
  1284. X!                 (void)mongets(mtmp, ELVEN_SPEAR);
  1285. X!                 (void)mongets(mtmp, ELVEN_SHIELD);
  1286. X!                 break;
  1287. X!             }
  1288. X! #else /* TOLKIEN */
  1289. X!         } else if (is_elf(ptr)) {
  1290. X!             (void)mongets(mtmp, ELVEN_CLOAK);
  1291. X!             if (rn2(3)) (void)mongets(mtmp, DAGGER);
  1292. X!             switch (rn2(3)) {
  1293. X!             case 0:
  1294. X!                 if (!rn2(4)) (void)mongets(mtmp, SMALL_SHIELD);
  1295. X!                 (void)mongets(mtmp, SHORT_SWORD);
  1296. X!                 (void)mongets(mtmp, BOW);
  1297. X!                 m_initthrow(mtmp, ARROW, 12);
  1298. X!                 break;
  1299. X!             case 1:
  1300. X!                 (void)mongets(mtmp, BROADSWORD);
  1301. X!                 if (rn2(2)) (void)mongets(mtmp, SMALL_SHIELD);
  1302. X!                 break;
  1303. X!             case 2:
  1304. X!                 (void)mongets(mtmp, SPEAR);
  1305. X!                 (void)mongets(mtmp, SMALL_SHIELD);
  1306. X!                 break;
  1307. X!             }
  1308. X! #endif
  1309. X!         }
  1310. X!         break;
  1311. X  
  1312. X          case S_HUMANOID:
  1313. X  #ifdef TOLKIEN
  1314. X***************
  1315. X*** 174,200 ****
  1316. X              } else {
  1317. X              (void)mongets(mtmp, PICK_AXE);
  1318. X              }
  1319. X-         } else if (is_elf(ptr)) {
  1320. X-             (void)mongets(mtmp,
  1321. X-             rn2(2) ? ELVEN_MITHRIL_COAT : ELVEN_CLOAK);
  1322. X-             if (rn2(2)) (void)mongets(mtmp, ELVEN_LEATHER_HELM);
  1323. X-             if (rn2(3)) (void)mongets(mtmp, ELVEN_DAGGER);
  1324. X-             switch (rn2(3)) {
  1325. X-             case 0:
  1326. X-                 if (!rn2(4)) (void)mongets(mtmp, ELVEN_SHIELD);
  1327. X-                 (void)mongets(mtmp, ELVEN_SHORT_SWORD);
  1328. X-                 (void)mongets(mtmp, ELVEN_BOW);
  1329. X-                 m_initthrow(mtmp, ELVEN_ARROW, 12);
  1330. X-                 break;
  1331. X-             case 1:
  1332. X-                 (void)mongets(mtmp, ELVEN_BROADSWORD);
  1333. X-                 if (rn2(2)) (void)mongets(mtmp, ELVEN_SHIELD);
  1334. X-                 break;
  1335. X-             case 2:
  1336. X-                 (void)mongets(mtmp, ELVEN_SPEAR);
  1337. X-                 (void)mongets(mtmp, ELVEN_SHIELD);
  1338. X-                 break;
  1339. X-             }
  1340. X          }
  1341. X  #else /* TOLKIEN */
  1342. X          if (is_dwarf(ptr)) {
  1343. X--- 218,223 ----
  1344. X***************
  1345. X*** 210,234 ****
  1346. X                  (void)mongets(mtmp, DWARVISH_MITHRIL_COAT);
  1347. X              } else {
  1348. X              (void)mongets(mtmp, PICK_AXE);
  1349. X-             }
  1350. X-         } else if (is_elf(ptr)) {
  1351. X-             (void)mongets(mtmp, ELVEN_CLOAK);
  1352. X-             if (rn2(3)) (void)mongets(mtmp, DAGGER);
  1353. X-             switch (rn2(3)) {
  1354. X-             case 0:
  1355. X-                 if (!rn2(4)) (void)mongets(mtmp, SMALL_SHIELD);
  1356. X-                 (void)mongets(mtmp, SHORT_SWORD);
  1357. X-                 (void)mongets(mtmp, BOW);
  1358. X-                 m_initthrow(mtmp, ARROW, 12);
  1359. X-                 break;
  1360. X-             case 1:
  1361. X-                 (void)mongets(mtmp, BROADSWORD);
  1362. X-                 if (rn2(2)) (void)mongets(mtmp, SMALL_SHIELD);
  1363. X-                 break;
  1364. X-             case 2:
  1365. X-                 (void)mongets(mtmp, SPEAR);
  1366. X-                 (void)mongets(mtmp, SMALL_SHIELD);
  1367. X-                 break;
  1368. X              }
  1369. X          }
  1370. X  #endif /* TOLKIEN */
  1371. X--- 233,238 ----
  1372. X*** src/mhitm.c    Thu May 31 00:31:36 1990
  1373. X--- src/mhitm.c    Sun Jan  6 15:56:11 1991
  1374. X***************
  1375. X*** 274,304 ****
  1376. X  
  1377. X      mx = magr->mx;
  1378. X      my = magr->my;
  1379. X!      /* move over top of the defender */
  1380. X      if(cansee(mdef->mx, mdef->my))    unpmon(mdef);
  1381. X      if(cansee(magr->mx, magr->my))    unpmon(magr);
  1382. X!     magr->mx = mdef->mx;
  1383. X!     magr->my = mdef->my;
  1384. X      if(cansee(magr->mx, magr->my))    pmon(magr);
  1385. X!     if((tmp = mdamagem(magr, mdef, mattk)) == 2) {
  1386. X!         remove_monster(mx, my);
  1387. X!         place_monster(magr, magr->mx, magr->my);
  1388. X          /* if mdamagem left a corpse it erased magr's symbol */
  1389. X          unpmon(magr);
  1390. X          pmon(magr);
  1391. X!         return(2);    /* defender died */
  1392. X      } else {        /* defender survived */
  1393. X          if(cansee(mdef->mx, mdef->my))
  1394. X              pline("%s is regurgitated!", Monnam(mdef));
  1395. X          if(cansee(magr->mx, magr->my))    unpmon(magr);
  1396. X!         magr->mx = mx;
  1397. X!         magr->my = my;
  1398. X          /* move off of defender */
  1399. X          if(cansee(magr->mx, magr->my))    pmon(magr);
  1400. X          if(cansee(mdef->mx, mdef->my))    pmon(mdef);
  1401. X-         nscr();
  1402. X-         return(tmp);
  1403. X      }
  1404. X  }
  1405. X  
  1406. X  static int
  1407. X--- 274,305 ----
  1408. X  
  1409. X      mx = magr->mx;
  1410. X      my = magr->my;
  1411. X!     /* move over top of the defender */
  1412. X      if(cansee(mdef->mx, mdef->my))    unpmon(mdef);
  1413. X      if(cansee(magr->mx, magr->my))    unpmon(magr);
  1414. X!     remove_monster(mx, my);
  1415. X!     place_monster(magr, mdef->mx, mdef->my);
  1416. X      if(cansee(magr->mx, magr->my))    pmon(magr);
  1417. X! 
  1418. X!     if((tmp = mdamagem(magr, mdef, mattk)) == 2) {    /* defender died */
  1419. X          /* if mdamagem left a corpse it erased magr's symbol */
  1420. X          unpmon(magr);
  1421. X          pmon(magr);
  1422. X!     } else if (tmp == -1) {    /* agressor died, put defender back */
  1423. X!         place_monster(mdef, mdef->mx, mdef->my);
  1424. X!         if(cansee(mdef->mx, mdef->my)) pmon(mdef);
  1425. X      } else {        /* defender survived */
  1426. X          if(cansee(mdef->mx, mdef->my))
  1427. X              pline("%s is regurgitated!", Monnam(mdef));
  1428. X          if(cansee(magr->mx, magr->my))    unpmon(magr);
  1429. X!         place_monster(magr, mx, my);
  1430. X!         place_monster(mdef, mdef->mx, mdef->my);
  1431. X          /* move off of defender */
  1432. X          if(cansee(magr->mx, magr->my))    pmon(magr);
  1433. X          if(cansee(mdef->mx, mdef->my))    pmon(mdef);
  1434. X      }
  1435. X+     nscr();
  1436. X+     return(tmp);
  1437. X  }
  1438. X  
  1439. X  static int
  1440. X***************
  1441. X*** 393,399 ****
  1442. X          tmp += destroy_mitem(mdef, SPBOOK_SYM, AD_FIRE);
  1443. X  #endif
  1444. X          if(resists_fire(pd)) {
  1445. X!             pline("The fire doesn't seem to burn %s!", mon_nam(mdef));
  1446. X              shieldeff(mdef->mx, mdef->my);
  1447. X  #ifdef GOLEMS
  1448. X              golemeffects(mdef, AD_FIRE, tmp);
  1449. X--- 394,402 ----
  1450. X          tmp += destroy_mitem(mdef, SPBOOK_SYM, AD_FIRE);
  1451. X  #endif
  1452. X          if(resists_fire(pd)) {
  1453. X!             if (vis)
  1454. X!             pline("The fire doesn't seem to burn %s!",
  1455. X!                                 mon_nam(mdef));
  1456. X              shieldeff(mdef->mx, mdef->my);
  1457. X  #ifdef GOLEMS
  1458. X              golemeffects(mdef, AD_FIRE, tmp);
  1459. X***************
  1460. X*** 410,417 ****
  1461. X          }
  1462. X          if(vis) pline("%s is covered in frost!", Monnam(mdef));
  1463. X          if(resists_cold(pd)) {
  1464. X!             pline("The frost doesn't seem to chill %s!",
  1465. X!             mon_nam(mdef));
  1466. X              shieldeff(mdef->mx, mdef->my);
  1467. X  #ifdef GOLEMS
  1468. X              golemeffects(mdef, AD_COLD, tmp);
  1469. X--- 413,421 ----
  1470. X          }
  1471. X          if(vis) pline("%s is covered in frost!", Monnam(mdef));
  1472. X          if(resists_cold(pd)) {
  1473. X!             if (vis)
  1474. X!             pline("The frost doesn't seem to chill %s!",
  1475. X!                                 mon_nam(mdef));
  1476. X              shieldeff(mdef->mx, mdef->my);
  1477. X  #ifdef GOLEMS
  1478. X              golemeffects(mdef, AD_COLD, tmp);
  1479. X***************
  1480. X*** 428,434 ****
  1481. X          if(vis) pline("%s gets zapped!", Monnam(mdef));
  1482. X          tmp += destroy_mitem(mdef, WAND_SYM, AD_ELEC);
  1483. X          if(resists_elec(pd)) {
  1484. X!             pline("The zap doesn't shock %s!", mon_nam(mdef));
  1485. X              shieldeff(mdef->mx, mdef->my);
  1486. X  #ifdef GOLEMS
  1487. X              golemeffects(mdef, AD_ELEC, tmp);
  1488. X--- 432,438 ----
  1489. X          if(vis) pline("%s gets zapped!", Monnam(mdef));
  1490. X          tmp += destroy_mitem(mdef, WAND_SYM, AD_ELEC);
  1491. X          if(resists_elec(pd)) {
  1492. X!             if (vis) pline("The zap doesn't shock %s!", mon_nam(mdef));
  1493. X              shieldeff(mdef->mx, mdef->my);
  1494. X  #ifdef GOLEMS
  1495. X              golemeffects(mdef, AD_ELEC, tmp);
  1496. X***************
  1497. X*** 444,453 ****
  1498. X              break;
  1499. X          }
  1500. X          if(resists_acid(pd)) {
  1501. X!             pline("%s is covered in acid, but it seems harmless.",
  1502. X!             Monnam(mdef));
  1503. X              tmp = 0;
  1504. X!         } else {
  1505. X              pline("%s is covered in acid!", Monnam(mdef));
  1506. X              pline("It burns %s!", mon_nam(mdef));
  1507. X          }
  1508. X--- 448,458 ----
  1509. X              break;
  1510. X          }
  1511. X          if(resists_acid(pd)) {
  1512. X!             if (vis)
  1513. X!             pline("%s is covered in acid, but it seems harmless.",
  1514. X!                             Monnam(mdef));
  1515. X              tmp = 0;
  1516. X!         } else if (vis) {
  1517. X              pline("%s is covered in acid!", Monnam(mdef));
  1518. X              pline("It burns %s!", mon_nam(mdef));
  1519. X          }
  1520. X*** src/mhitu.c    Tue Jun 26 21:20:24 1990
  1521. X--- src/mhitu.c    Sat Jan  5 14:59:32 1991
  1522. X***************
  1523. X*** 665,670 ****
  1524. X--- 665,671 ----
  1525. X  #  ifdef POLYSELF
  1526. X                          && !resists_drli(uasmon)
  1527. X  #  endif
  1528. X+                         && !defends(AD_DRLI, uwep)
  1529. X                                      ) {
  1530. X                  if (Blind)
  1531. X                  You("feel an unholy blade drain your life!");
  1532. X*** src/mkmaze.c    Tue May 15 14:50:37 1990
  1533. X--- src/mkmaze.c    Wed Jan 30 12:05:06 1991
  1534. X***************
  1535. X*** 413,447 ****
  1536. X  bound_digging()
  1537. X  /* put a non-diggable boundary around the initial portion of a level map.
  1538. X   * assumes that no level will initially put things beyond the isok() range.
  1539. X   */
  1540. X  {
  1541. X      register int x,y;
  1542. X!     register boolean found;
  1543. X      int xmin,xmax,ymin,ymax;
  1544. X  
  1545. X!     found = FALSE;
  1546. X!     for(xmin=1; !found; xmin++)
  1547. X!         for(y=0; y<=ROWNO-1; y++)
  1548. X!             if(levl[xmin][y].typ != STONE) found = TRUE;
  1549. X!     xmin -= 2;
  1550. X  
  1551. X!     found = FALSE;
  1552. X!     for(xmax=COLNO-2; !found; xmax--)
  1553. X!         for(y=0; y<=ROWNO-1; y++)
  1554. X!             if(levl[xmax][y].typ != STONE) found = TRUE;
  1555. X!     xmax += 2;
  1556. X  
  1557. X!     found = FALSE;
  1558. X!     for(ymin=1; !found; ymin++)
  1559. X!         for(x=xmin; x<=xmax; x++)
  1560. X!             if(levl[x][ymin].typ != STONE) found = TRUE;
  1561. X!     ymin -= 2;
  1562. X  
  1563. X!     found = FALSE;
  1564. X!     for(ymax=ROWNO-2; !found; ymax--)
  1565. X!         for(x=xmin; x<=xmax; x++)
  1566. X!             if(levl[x][ymax].typ != STONE) found = TRUE;
  1567. X!     ymax += 2;
  1568. X  
  1569. X      for(x=xmin; x<=xmax; x++) {
  1570. X          levl[x][ymin].diggable = W_NONDIGGABLE;
  1571. X--- 413,479 ----
  1572. X  bound_digging()
  1573. X  /* put a non-diggable boundary around the initial portion of a level map.
  1574. X   * assumes that no level will initially put things beyond the isok() range.
  1575. X+  *
  1576. X+  * we can't bound unconditionally on the last line with something in it,
  1577. X+  * because that something might be a niche which was already reachable,
  1578. X+  * so the boundary would be breached
  1579. X+  *
  1580. X+  * we can't bound unconditionally on one beyond the last line, because
  1581. X+  * that provides a window of abuse for WALLIFIED_MAZE special levels
  1582. X   */
  1583. X  {
  1584. X      register int x,y;
  1585. X!     register unsigned typ;
  1586. X!     boolean found, nonwall;
  1587. X      int xmin,xmax,ymin,ymax;
  1588. X  
  1589. X!     found = nonwall = FALSE;
  1590. X!     for(xmin=0; !found; xmin++)
  1591. X!         for(y=0; y<=ROWNO-1; y++) {
  1592. X!             typ = levl[xmin][y].typ;
  1593. X!             if(typ != STONE) {
  1594. X!                 found = TRUE;
  1595. X!                 if(!IS_WALL(typ)) nonwall = TRUE;
  1596. X!             }
  1597. X!         }
  1598. X!     xmin -= (nonwall ? 2 : 1);
  1599. X!     if (xmin < 0) xmin = 0;
  1600. X  
  1601. X!     found = nonwall = FALSE;
  1602. X!     for(xmax=COLNO-1; !found; xmax--)
  1603. X!         for(y=0; y<=ROWNO-1; y++) {
  1604. X!             typ = levl[xmax][y].typ;
  1605. X!             if(typ != STONE) {
  1606. X!                 found = TRUE;
  1607. X!                 if(!IS_WALL(typ)) nonwall = TRUE;
  1608. X!             }
  1609. X!         }
  1610. X!     xmax += (nonwall ? 2 : 1);
  1611. X!     if (xmax >= COLNO) xmax = COLNO-1;
  1612. X  
  1613. X!     found = nonwall = FALSE;
  1614. X!     for(ymin=0; !found; ymin++)
  1615. X!         for(x=xmin; x<=xmax; x++) {
  1616. X!             typ = levl[x][ymin].typ;
  1617. X!             if(typ != STONE) {
  1618. X!                 found = TRUE;
  1619. X!                 if(!IS_WALL(typ)) nonwall = TRUE;
  1620. X!             }
  1621. X!         }
  1622. X!     ymin -= (nonwall ? 2 : 1);
  1623. X!     if (ymin < 0) ymin = 0;
  1624. X  
  1625. X!     found = nonwall = FALSE;
  1626. X!     for(ymax=ROWNO-1; !found; ymax--)
  1627. X!         for(x=xmin; x<=xmax; x++) {
  1628. X!             typ = levl[x][ymax].typ;
  1629. X!             if(typ != STONE) {
  1630. X!                 found = TRUE;
  1631. X!                 if(!IS_WALL(typ)) nonwall = TRUE;
  1632. X!             }
  1633. X!         }
  1634. X!     ymax += (nonwall ? 2 : 1);
  1635. X!     if (ymax >= ROWNO) ymax = ROWNO-1;
  1636. X  
  1637. X      for(x=xmin; x<=xmax; x++) {
  1638. X          levl[x][ymin].diggable = W_NONDIGGABLE;
  1639. X*** src/mon.c    Tue Jun 26 21:20:25 1990
  1640. X--- src/mon.c    Tue Feb  5 15:37:59 1991
  1641. X***************
  1642. X*** 3,17 ****
  1643. X  /* NetHack may be freely redistributed.  See license for details. */
  1644. X  
  1645. X  /* Aztec C on amiga doesn't recognize defined() at this point!
  1646. X!    Neither does the Mac Lightspeed C v.3  compiler. If you're using
  1647. X!    precompiled headers, you don't want this either */
  1648. X! #ifndef AZTEC_C
  1649. X! #ifndef THINK_C
  1650. X! #if defined(MICROPORT_BUG) || (!defined(LINT) && !defined(__STDC__))
  1651. X! #define MKROOM_H
  1652. X! #endif /* Avoid the microport bug */
  1653. X! #endif
  1654. X! #endif
  1655. X  
  1656. X  #include "hack.h"
  1657. X  #include "mfndpos.h"
  1658. X--- 3,18 ----
  1659. X  /* NetHack may be freely redistributed.  See license for details. */
  1660. X  
  1661. X  /* Aztec C on amiga doesn't recognize defined() at this point!
  1662. X!    Neither does the Mac Lightspeed C v.3  compiler. */
  1663. X! #ifdef MICROPORT_BUG        /* comment line for pre-compiled headers */
  1664. X! # define MKROOM_H        /* comment line for pre-compiled headers */
  1665. X! #else                /* comment line for pre-compiled headers */
  1666. X! # ifndef LINT            /* comment line for pre-compiled headers */
  1667. X! #  ifndef __STDC__        /* comment line for pre-compiled headers */
  1668. X! #   define MKROOM_H        /* comment line for pre-compiled headers */
  1669. X! #  endif            /* comment line for pre-compiled headers */
  1670. X! # endif                /* comment line for pre-compiled headers */
  1671. X! #endif                /* comment line for pre-compiled headers */
  1672. X  
  1673. X  #include "hack.h"
  1674. X  #include "mfndpos.h"
  1675. X***************
  1676. X*** 30,35 ****
  1677. X--- 31,37 ----
  1678. X  STATIC_DCL void NDECL(dmonsfree);
  1679. X  
  1680. X  #ifdef OVL1
  1681. X+ #define warnDelay 10
  1682. X  long lastwarntime;
  1683. X  int lastwarnlev;
  1684. X  const char *warnings[] = {
  1685. X***************
  1686. X*** 125,135 ****
  1687. X--- 127,139 ----
  1688. X          pieces = d(2,6);
  1689. X          while (pieces--)
  1690. X              obj = mksobj_at(IRON_CHAIN, x, y);
  1691. X+         mtmp->mnamelth = 0;
  1692. X          break;
  1693. X          case PM_CLAY_GOLEM:
  1694. X          obj = mksobj_at(ROCK, x, y);
  1695. X          obj->quan = rn2(20) + 100;
  1696. X          obj->owt = weight(obj);
  1697. X+         mtmp->mnamelth = 0;
  1698. X          break;
  1699. X          case PM_STONE_GOLEM:
  1700. X          obj = mkcorpstat(STATUE, mdat, x, y);
  1701. X***************
  1702. X*** 138,148 ****
  1703. X--- 142,154 ----
  1704. X          pieces = d(2,4);
  1705. X          while(pieces--)
  1706. X              obj = mksobj_at(QUARTERSTAFF, x, y);
  1707. X+         mtmp->mnamelth = 0;
  1708. X          break;
  1709. X          case PM_LEATHER_GOLEM:
  1710. X          pieces = d(2,4);
  1711. X          while(pieces--)
  1712. X              obj = mksobj_at(LEATHER_ARMOR, x, y);
  1713. X+         mtmp->mnamelth = 0;
  1714. X          break;
  1715. X  #endif
  1716. X          default_1:
  1717. X***************
  1718. X*** 187,192 ****
  1719. X--- 193,199 ----
  1720. X  movemon()
  1721. X  {
  1722. X      register struct monst *mtmp;
  1723. X+     boolean check_tame = TRUE;
  1724. X  
  1725. X      warnlevel = 0;
  1726. X  
  1727. X***************
  1728. X*** 201,208 ****
  1729. X           * attack the tame monster back (which it's permitted to do
  1730. X           * only if it hasn't made its move yet).
  1731. X           */
  1732. X!         for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
  1733. X              if(mtmp->mlstmv < moves && mtmp->mtame) goto next_mon;
  1734. X          for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
  1735. X              if(mtmp->mlstmv < moves && !mtmp->mtame) goto next_mon;
  1736. X          /* treated all monsters */
  1737. X--- 208,218 ----
  1738. X           * attack the tame monster back (which it's permitted to do
  1739. X           * only if it hasn't made its move yet).
  1740. X           */
  1741. X!         if (check_tame) {
  1742. X!             for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
  1743. X              if(mtmp->mlstmv < moves && mtmp->mtame) goto next_mon;
  1744. X+             check_tame = FALSE;        /* tame monsters all done */
  1745. X+         }
  1746. X          for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
  1747. X              if(mtmp->mlstmv < moves && !mtmp->mtame) goto next_mon;
  1748. X          /* treated all monsters */
  1749. X***************
  1750. X*** 307,315 ****
  1751. X      }
  1752. X  #ifdef NAMED_ITEMS
  1753. X      if (warnlevel == 100) {
  1754. X          Your("%s %s!", aobjnam(uwep, "glow"),
  1755. X!             Hallucination ? hcolor() : light_blue);
  1756. X!         warnlevel = 0;
  1757. X      }
  1758. X  #endif
  1759. X      warnlevel -= u.ulevel;
  1760. X--- 317,331 ----
  1761. X      }
  1762. X  #ifdef NAMED_ITEMS
  1763. X      if (warnlevel == 100) {
  1764. X+         if(!Blind && (warnlevel > lastwarnlev
  1765. X+                 || moves > lastwarntime + warnDelay)) {
  1766. X          Your("%s %s!", aobjnam(uwep, "glow"),
  1767. X!             Hallucination ? hcolor() : light_blue);
  1768. X!         lastwarnlev = warnlevel;
  1769. X!         lastwarntime = moves;
  1770. X!         }
  1771. X!         warnlevel = 0;
  1772. X!         return;
  1773. X      }
  1774. X  #endif
  1775. X      warnlevel -= u.ulevel;
  1776. X***************
  1777. X*** 316,322 ****
  1778. X      if(warnlevel >= SIZE(warnings))
  1779. X          warnlevel = SIZE(warnings)-1;
  1780. X      if(!Blind && warnlevel >= 0)
  1781. X!     if(warnlevel > lastwarnlev || moves > lastwarntime + 5){
  1782. X          register const char *rr;
  1783. X      
  1784. X          switch((int) (Warning & (LEFT_RING | RIGHT_RING))){
  1785. X--- 332,338 ----
  1786. X      if(warnlevel >= SIZE(warnings))
  1787. X          warnlevel = SIZE(warnings)-1;
  1788. X      if(!Blind && warnlevel >= 0)
  1789. X!     if(warnlevel > lastwarnlev || moves > lastwarntime + warnDelay) {
  1790. X          register const char *rr;
  1791. X      
  1792. X          switch((int) (Warning & (LEFT_RING | RIGHT_RING))){
  1793. X***************
  1794. X*** 405,410 ****
  1795. X--- 421,429 ----
  1796. X      for (otmp = level.objects[mtmp->mx][mtmp->my]; otmp; otmp = otmp2) {
  1797. X          otmp2 = otmp->nexthere;
  1798. X          if(objects[otmp->otyp].oc_material <= WOOD) {
  1799. X+         if (otmp->otyp == CORPSE && otmp->corpsenm == PM_COCKATRICE
  1800. X+                         && !resists_ston(mtmp->data))
  1801. X+             continue;
  1802. X          if (cansee(mtmp->mx,mtmp->my) && flags.verbose)
  1803. X              pline("%s eats %s!", Monnam(mtmp),
  1804. X                  distant_name(otmp, doname));
  1805. X***************
  1806. X*** 676,692 ****
  1807. X          { register struct trap *ttmp = t_at(nx, ny);
  1808. X            register long tt;
  1809. X              if(ttmp) {
  1810. X! /*                tt = 1L << ttmp->ttyp;*/
  1811. X! /* why don't we just have code look like what it's supposed to do? then it
  1812. X! /* might start working for every case. try this instead: -sac */
  1813. X!                 tt = (ttmp->ttyp < TRAPNUM && ttmp->ttyp);
  1814. X!                 /* below if added by GAN 02/06/87 to avoid
  1815. X!                  * traps out of range
  1816. X!                  */
  1817. X!                 if(!(tt & ALLOW_TRAPS))  {
  1818. X  impossible("A monster looked at a very strange trap of type %d.", ttmp->ttyp);
  1819. X                      continue;
  1820. X                  }
  1821. X                  if(mon->mtrapseen & tt) {
  1822. X  
  1823. X                      if(!(flag & tt)) continue;
  1824. X--- 695,705 ----
  1825. X          { register struct trap *ttmp = t_at(nx, ny);
  1826. X            register long tt;
  1827. X              if(ttmp) {
  1828. X!                 if(ttmp->ttyp >= TRAPNUM || ttmp->ttyp == 0)  {
  1829. X  impossible("A monster looked at a very strange trap of type %d.", ttmp->ttyp);
  1830. X                      continue;
  1831. X                  }
  1832. X+                 tt = 1L << ttmp->ttyp;
  1833. X                  if(mon->mtrapseen & tt) {
  1834. X  
  1835. X                      if(!(flag & tt)) continue;
  1836. X***************
  1837. X*** 1303,1311 ****
  1838. X          return(TRUE);
  1839. X      } else
  1840. X          if(levl[mtmp->mx][mtmp->my].typ == ROOM)  {
  1841. X!         (void) maketrap(mtmp->mx, mtmp->my, MONST_TRAP);
  1842. X          /* override type selection */
  1843. X-         ftrap->pm = monsndx(mtmp->data);
  1844. X          mondead(mtmp);
  1845. X          return(TRUE);
  1846. X          }
  1847. X--- 1316,1324 ----
  1848. X          return(TRUE);
  1849. X      } else
  1850. X          if(levl[mtmp->mx][mtmp->my].typ == ROOM)  {
  1851. X!         maketrap(mtmp->mx, mtmp->my, MONST_TRAP)->pm =
  1852. X!             monsndx(mtmp->data);
  1853. X          /* override type selection */
  1854. X          mondead(mtmp);
  1855. X          return(TRUE);
  1856. X          }
  1857. X*** src/monmove.c    Thu May 31 00:31:43 1990
  1858. X--- src/monmove.c    Sat Jan  5 15:07:17 1991
  1859. X***************
  1860. X*** 379,385 ****
  1861. X      register struct monst *mtmp2;
  1862. X      register int nx,ny,omx,omy,appr,nearer,cnt,i,j;
  1863. X      xchar gx,gy,nix,niy,chcnt;
  1864. X!     schar chi;
  1865. X      boolean likegold=0, likegems=0, likeobjs=0, likemagic=0, conceals=0;
  1866. X      boolean likerock=0, can_tunnel=0;
  1867. X      boolean can_open=0, can_unlock=0, doorbuster=0;
  1868. X--- 379,385 ----
  1869. X      register struct monst *mtmp2;
  1870. X      register int nx,ny,omx,omy,appr,nearer,cnt,i,j;
  1871. X      xchar gx,gy,nix,niy,chcnt;
  1872. X!     int chi;        /* could be schar except for stupid Sun-2 compiler */
  1873. X      boolean likegold=0, likegems=0, likeobjs=0, likemagic=0, conceals=0;
  1874. X      boolean likerock=0, can_tunnel=0;
  1875. X      boolean can_open=0, can_unlock=0, doorbuster=0;
  1876. X***************
  1877. X*** 560,566 ****
  1878. X                otmp->otyp < LAST_GEM + 6) ||
  1879. X               (conceals && !cansee(otmp->ox,otmp->oy)) ||
  1880. X               (ptr == &mons[PM_GELATINOUS_CUBE] &&
  1881. X!               !index(indigestion, otmp->olet))
  1882. X               ) {
  1883. X                if(can_carry(mtmp,otmp))
  1884. X                  if(ptr->mlet != S_UNICORN ||
  1885. X--- 560,568 ----
  1886. X                otmp->otyp < LAST_GEM + 6) ||
  1887. X               (conceals && !cansee(otmp->ox,otmp->oy)) ||
  1888. X               (ptr == &mons[PM_GELATINOUS_CUBE] &&
  1889. X!               !index(indigestion, otmp->olet) &&
  1890. X!               !(otmp->otyp == CORPSE &&
  1891. X!                   otmp->corpsenm == PM_COCKATRICE))
  1892. X               ) {
  1893. X                if(can_carry(mtmp,otmp))
  1894. X                  if(ptr->mlet != S_UNICORN ||
  1895. X
  1896. END_OF_FILE
  1897. if test 50088 -ne `wc -c <'patch10.02'`; then
  1898.     echo shar: \"'patch10.02'\" unpacked with wrong size!
  1899. fi
  1900. # end of 'patch10.02'
  1901. echo shar: End of archive 5 \(of 8\).
  1902. cp /dev/null ark5isdone
  1903. MISSING=""
  1904. for I in 1 2 3 4 5 6 7 8 ; do
  1905.     if test ! -f ark${I}isdone ; then
  1906.     MISSING="${MISSING} ${I}"
  1907.     fi
  1908. done
  1909. if test "${MISSING}" = "" ; then
  1910.     echo You have unpacked all 8 archives.
  1911.     rm -f ark[1-9]isdone
  1912. else
  1913.     echo You still need to unpack the following archives:
  1914.     echo "        " ${MISSING}
  1915. fi
  1916. ##  End of shell archive.
  1917. exit 0
  1918.